package com.ruoyi.common.enums;

import java.util.HashMap;
import java.util.Map;

public enum BillType {
	会计凭证("0", "凭证类型_会计"),

	对账单凭证("1", "凭证类型_对账单"),
	对账协议单("2", "凭证类型_对账协议单");
	

	public static BillType toArcBatchStatus(String value) {
		return codeMap.get(value);
	}

	public static String getNameByCode(String value) {
		BillType status = codeMap.get(value);
		if (status != null) {
			return status.getName();
		}
		return "未知状态";
	}

	private static Map<String, BillType> codeMap;
	private static Map<String, BillType> nameMap;
	static {
		codeMap = new HashMap<String, BillType>();
		nameMap = new HashMap<String, BillType>();
		for (BillType status : BillType.values()) {
			codeMap.put(status.getValue(), status);
			nameMap.put(status.getName(), status);
		}
	}
	private String value;
	private String name;

	private BillType(String value, String name) {
		this.value = value;
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public String getName() {
		return name;
	}

	public String toString() {
		return this.getValue() + "-" + this.getName();
	}

	public static void main(String[] args) {
		for (BillType status : BillType.values()) {
			//System.out.println(status);
		}
	}
}
